package com.example.xianji.adapter;

import java.util.ArrayList;

import com.example.xianji.R;
import com.example.xianji.bean.BaiKe_Fenlei_DuiXiang;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class BaiKe_FenLei_Adapter extends BaseAdapter {
private Context mContext;
private ArrayList<BaiKe_Fenlei_DuiXiang> list;




	

	public BaiKe_FenLei_Adapter(Context mContext,
		ArrayList<BaiKe_Fenlei_DuiXiang> list, int selection) {
	super();
	this.mContext = mContext;
	this.list = list;
	
}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return position;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		MyHolder mMyHolder=null;
		if(convertView==null){
		
			mMyHolder=new MyHolder();
			convertView=View.inflate(mContext, R.layout.baike_fenlei_item, null);
			mMyHolder.baike_fenlei_yiji_title=(TextView) convertView.findViewById(R.id.baike_fenlei_yiji_title);
			mMyHolder.relative_item_background=(RelativeLayout) convertView.findViewById(R.id.relative_item_background);
			convertView.setTag(mMyHolder);
			
		}
		mMyHolder=(MyHolder) convertView.getTag();
		
		mMyHolder.baike_fenlei_yiji_title.setText(list.get(position).getTitle());
		return convertView;
	}
class MyHolder{
	TextView baike_fenlei_yiji_title;
	RelativeLayout relative_item_background;
}
}
